home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxclip.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.1 KB  |  73 lines

  1. /* Copyright (C) 1998, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxclip.h,v 1.2 2000/09/19 19:00:34 lpd Exp $ */
  20. /* Internal definitions for clipping */
  21.  
  22. #ifndef gxclip_INCLUDED
  23. #  define gxclip_INCLUDED
  24.  
  25. /*
  26.  * Both rectangle list and mask clipping use callback procedures to process
  27.  * each rectangle selected by the clipping region.  They share both the
  28.  * callback procedures themselves and the structure that provides closure
  29.  * data for these procedures.  We define a single closure structure, rather
  30.  * than one per client/callback, just to reduce source code clutter.  The
  31.  * comments below show which clients use each member.
  32.  */
  33. typedef struct clip_callback_data_s {
  34.     /*
  35.      * The original driver procedure stores the following of its arguments
  36.      * that the callback procedure or the clipping algorithm needs.
  37.      */
  38.     gx_device *tdev;        /* target device (always set) */
  39.     int x, y, w, h;        /* (always set) */
  40.     gx_color_index color[2];    /* (all but copy_color) */
  41.     const byte *data;        /* copy_*, fill_mask */
  42.     int sourcex;        /* ibid. */
  43.     uint raster;        /* ibid. */
  44.     int depth;            /* copy_alpha, fill_mask */
  45.     const gx_drawing_color *pdcolor;    /* fill_mask */
  46.     gs_logical_operation_t lop;    /* fill_mask, strip_copy_rop */
  47.     const gx_clip_path *pcpath;    /* fill_mask */
  48.     const gx_strip_bitmap *tiles;    /* strip_tile_rectangle */
  49.     gs_int_point phase;        /* strip_* */
  50.     const gx_color_index *scolors;    /* strip_copy_rop */
  51.     const gx_strip_bitmap *textures;    /* ibid. */
  52.     const gx_color_index *tcolors;    /* ibid. */
  53. } clip_callback_data_t;
  54.  
  55. /* Declare the callback procedures. */
  56. int
  57.     clip_call_fill_rectangle(P5(clip_callback_data_t * pccd,
  58.                 int xc, int yc, int xec, int yec)),
  59.     clip_call_copy_mono(P5(clip_callback_data_t * pccd,
  60.                int xc, int yc, int xec, int yec)),
  61.     clip_call_copy_color(P5(clip_callback_data_t * pccd,
  62.                 int xc, int yc, int xec, int yec)),
  63.     clip_call_copy_alpha(P5(clip_callback_data_t * pccd,
  64.                 int xc, int yc, int xec, int yec)),
  65.     clip_call_fill_mask(P5(clip_callback_data_t * pccd,
  66.                int xc, int yc, int xec, int yec)),
  67.     clip_call_strip_tile_rectangle(P5(clip_callback_data_t * pccd,
  68.                       int xc, int yc, int xec, int yec)),
  69.     clip_call_strip_copy_rop(P5(clip_callback_data_t * pccd,
  70.                 int xc, int yc, int xec, int yec));
  71.  
  72. #endif /* gxclip_INCLUDED */
  73.